package it.lupo.core.gui.controller;

import it.lupo.core.LupoSession;
import it.lupo.core.gui.MainApp;

import java.net.URL;
import java.util.ResourceBundle;

import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Label;

public class ConfermentController  implements Initializable{

	@FXML
	private Label message;
	
	public static String FXML_FILE = "src/main/resources/conferment.fxml";
	
	 
	 
	
	@FXML
	public void close()
	{
		try {
			MainApp.getInstance().change(HomeController.FXML_FILE);
			LupoSession.getCurrent().removeType();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}



	@Override
	public void initialize(URL arg0, ResourceBundle arg1) {
		LupoSession session = LupoSession.getCurrent();
		System.out.println(session.getUser()+" : "+session.getType());
		 
		switch(session.getType())
		{
			case PLASTIC:message.setText("Plastica");break;
			case PAPER:message.setText("Carta");break;
			case GLASS:message.setText("Vetro");break;
		}
			
		 
		
	}
}
